<script>	
import { loginWeChatApplet } from "./api/index.js"
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			uni.login({
			success(res) {
				console.log(res.code)
				if (res.code) {
					loginWeChatApplet({
						code:res.code
					}).then((res)=>{
						console.log(res);
						uni.setStorage({
								key: 'info',
								data: {
									token: res.data.token,
								}
							})
					})
				}
			}
		})
		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
</style>
